<!DOCTYPE html>
<html>
<head>
    <link href="/css/layui/css/layui.css" rel="stylesheet">
    <link href="/css/hadmin/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
    <link href="/css/hadmin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/css/hadmin/css/animate.css" rel="stylesheet">
    <link href="/css/hadmin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/css/hadmin/css/animate.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/jquery.fancybox.min.css"/>
</head>

<div class="wrapper wrapper-content animated fadeInUp">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>我的背包</h5>
                </div>
                <div class="ibox-content">
                    <div class="form-group">
                        <form class="form-inline" method="post" action="/user/rucksack" id="form">
                            <input type="hidden" name="export" id='export' value="/">
                            <input type="text" placeholder="请输入用户id" name="user_id" value="<?=$uid?>"
                                   class="form-control">
                            <button type="button" class="btn btn-primary" id="search"> 搜索</button>
                            <!--<a class="btn btn-primary radius" data-toggle="modal" data-target="#myModal">添加道具</a>-->
                            <a class="btn btn-primary radius" id="excle">数据导出</a>
                        </form>
                    </div>
                </div>
                <div class="page-container">
                    <div class="mt-20">
                        <table class="table table-hover table-striped">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>用户昵称</th>
                                <th>道具名称</th>
                                <th>道具数量</th>
                            </tr>
                            </thead>
                            <?php foreach($params as $value): ?>
                            <tbody>
                            <td><?=$value['User']['id']?></td>
                            <td><?=$value['u']['nickname']?></td>
                            <td><?=$value['p']['prop_name']?></td>
                            <td><?=$value['User']['num']?></td>
                            </tbody>
                            <?php endforeach; ?>
                        </table>
                    </div>
                </div>
                <?php if($pageCount > 1): ?>
                <nav aria-label="Page navigation">
                    <ul class="pagination">
                        <li
                        <?php if($page == 1 || !$page): ?> class="disabled" <?php endif; ?> >
                        <a <?php if($page == 1 || !$page): ?>  onclick="return false" <?php endif; ?>
                        href="<?= $url.'?page='.($page-1) ?>" aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                        </a>
                        </li>
                        <?php for($i=0;$i<$pageCount;$i++): ?>
                        <li
                        <?php if($page == $i+1): ?> class="active" <?php endif; ?>><a
                            href="<?= $url.'?page='.($i+1) ?>"><?=$i+1?></a></li>
                        <?php endfor; ?>
                        <li
                        <?php if($page == $pageCount): ?> class="disabled" <?php endif; ?> >
                        <a <?php if($page == $pageCount): ?> onclick="return false" <?php endif; ?>
                        href="<?= $url.'?page='.($page+1) ?>" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                        </a>
                        </li>
                    </ul>
                </nav>
                <?php endif; ?>
            </div>
        </div>
    </div>
</div>
</div>


</html>

<script src="/css/layui/layui.js"></script>
<script src="/css/hadmin/js/jquery.min.js?v=2.1.4"></script>
<script src="/css/hadmin/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/css/hadmin/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/css/hadmin/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/css/hadmin/js//hAdmin.js?v=4.1.0"></script>
<script src="/css/hadmin/js/index.js"></script>
<script src="/css/hadmin/js/plugins/toastr/toastr.min.js"></script>

<script>
    //导出excle
    $("#excle").click(function () {
        $("#export").val('wyq');
        $("#form").submit();
    })

    //筛选
    $("#search").click(function () {
        $("#export").val('');
        $("#form").submit();
    })
</script>